module regfile(/*AUTOARG*/
   // Outputs
   read_data1, read_data2, read_data3, read_data4,
   // Inputs
   clk, reset, wr1, wr2, wen1, wen2, w_data1, w_data2, ren1, ren2,
   ren3, ren4
   );

input clk;
input reset;
input wr1;
input wr2;
input [31:0] wen1;
input [31:0] wen2;
input [31:0] w_data1;
input [31:0] w_data2;
input [31:0] ren1;
input [31:0] ren2;
input [31:0] ren3;
input [31:0] ren4;
output [31:0] read_data1;
output [31:0] read_data2;
output [31:0] read_data3;
output [31:0] read_data4;

wire [31:0] read_data1_31,read_data2_31,read_data3_31,read_data4_31  ;
wire [31:0] read_data1_30,read_data2_30,read_data3_30,read_data4_30  ;
wire [31:0] read_data1_29,read_data2_29,read_data3_29,read_data4_29  ;
wire [31:0] read_data1_28,read_data2_28,read_data3_28,read_data4_28  ;
wire [31:0] read_data1_27,read_data2_27,read_data3_27,read_data4_27  ;
wire [31:0] read_data1_26,read_data2_26,read_data3_26,read_data4_26  ;
wire [31:0] read_data1_25,read_data2_25,read_data3_25,read_data4_25  ;
wire [31:0] read_data1_24,read_data2_24,read_data3_24,read_data4_24  ;
wire [31:0] read_data1_23,read_data2_23,read_data3_23,read_data4_23  ;
wire [31:0] read_data1_22,read_data2_22,read_data3_22,read_data4_22  ;
wire [31:0] read_data1_21,read_data2_21,read_data3_21,read_data4_21  ;
wire [31:0] read_data1_20,read_data2_20,read_data3_20,read_data4_20  ;
wire [31:0] read_data1_19,read_data2_19,read_data3_19,read_data4_19  ;
wire [31:0] read_data1_18,read_data2_18,read_data3_18,read_data4_18  ;
wire [31:0] read_data1_17,read_data2_17,read_data3_17,read_data4_17  ;
wire [31:0] read_data1_16,read_data2_16,read_data3_16,read_data4_16  ;
wire [31:0] read_data1_15,read_data2_15,read_data3_15,read_data4_15  ;
wire [31:0] read_data1_14,read_data2_14,read_data3_14,read_data4_14  ;
wire [31:0] read_data1_13,read_data2_13,read_data3_13,read_data4_13  ;
wire [31:0] read_data1_12,read_data2_12,read_data3_12,read_data4_12  ;
wire [31:0] read_data1_11,read_data2_11,read_data3_11,read_data4_11  ;
wire [31:0] read_data1_10,read_data2_10,read_data3_10,read_data4_10  ;
wire [31:0] read_data1_9,read_data2_9,read_data3_9,read_data4_9  ;
wire [31:0] read_data1_8,read_data2_8,read_data3_8,read_data4_8  ;
wire [31:0] read_data1_7,read_data2_7,read_data3_7,read_data4_7  ;
wire [31:0] read_data1_6,read_data2_6,read_data3_6,read_data4_6  ;
wire [31:0] read_data1_5,read_data2_5,read_data3_5,read_data4_5  ;
wire [31:0] read_data1_4,read_data2_4,read_data3_4,read_data4_4  ;
wire [31:0] read_data1_3,read_data2_3,read_data3_3,read_data4_3  ;
wire [31:0] read_data1_2,read_data2_2,read_data3_2,read_data4_2  ;
wire [31:0] read_data1_1,read_data2_1,read_data3_1,read_data4_1  ;
wire [31:0] read_data1_0,read_data2_0,read_data3_0,read_data4_0  ;


assign read_data1 = read_data1_31 |read_data1_30 |read_data1_29 |read_data1_28 |read_data1_27 |read_data1_26 |read_data1_25 |
read_data1_24 |read_data1_23 |read_data1_22 |read_data1_21 |read_data1_20 |read_data1_19 |read_data1_18 |read_data1_17 |
read_data1_16 |read_data1_15 |read_data1_14 |read_data1_13 |read_data1_12 |read_data1_11 |read_data1_10 |read_data1_9 |
read_data1_8 |read_data1_7 |read_data1_6 |read_data1_5 |read_data1_4 |read_data1_3 |read_data1_2 |read_data1_1 |read_data1_0;

assign read_data2 = read_data2_31 |read_data2_30 |read_data2_29 |read_data2_28 |read_data2_27 |read_data2_26 |read_data2_25 |
read_data2_24 |read_data2_23 |read_data2_22 |read_data2_21 |read_data2_20 |read_data2_19 |read_data2_18 |read_data2_17 |
read_data2_16 |read_data2_15 |read_data2_14 |read_data2_13 |read_data2_12 |read_data2_11 |read_data2_10 |read_data2_9 |
read_data2_8 |read_data2_7 |read_data2_6 |read_data2_5 |read_data2_4 |read_data2_3 |read_data2_2 |read_data2_1 |read_data2_0;

assign read_data3 = read_data3_31 |read_data3_30 |read_data3_29 |read_data3_28 |read_data3_27 |read_data3_26 |read_data3_25 |
read_data3_24 |read_data3_23 |read_data3_22 |read_data3_21 |read_data3_20 |read_data3_19 |read_data3_18 |read_data3_17 |
read_data3_16 |read_data3_15 |read_data3_14 |read_data3_13 |read_data3_12 |read_data3_11 |read_data3_10 |read_data3_9 |
read_data3_8 |read_data3_7 |read_data3_6 |read_data3_5 |read_data3_4 |read_data3_3 |read_data3_2 |read_data3_1 |read_data3_0;

assign read_data4 = read_data4_31 |read_data4_30 |read_data4_29 |read_data4_28 |read_data4_27 |read_data4_26 |read_data4_25 |
read_data4_24 |read_data4_23 |read_data4_22 |read_data4_21 |read_data4_20 |read_data4_19 |read_data4_18 |read_data4_17 |
read_data4_16 |read_data4_15 |read_data4_14 |read_data4_13 |read_data4_12 |read_data4_11 |read_data4_10 |read_data4_9 |
read_data4_8 |read_data4_7 |read_data4_6 |read_data4_5 |read_data4_4 |read_data4_3 |read_data4_2 |read_data4_1 |read_data4_0;


line lne31 (.clk(clk),.reset(reset),
.wr1(wr1), .wr2(wr2),
.wen1(wen1[31]),
.wen2(wen2[31]),
.ren1(ren1[31]),
.ren2(ren2[31]),
.ren3(ren3[31]),
.ren4(ren4[31]),
.w_data1(w_data1),
.w_data2(w_data2),
.read_data1(read_data1_31), 
.read_data2(read_data2_31),
.read_data3(read_data3_31), 
.read_data4(read_data4_31)); 

line lne30 (.clk(clk),.reset(reset),
.wr1(wr1), .wr2(wr2),
.wen1(wen1[30]),
.wen2(wen2[30]),
.ren1(ren1[30]),
.ren2(ren2[30]),
.ren3(ren3[30]),
.ren4(ren4[30]),
.w_data1(w_data1),
.w_data2(w_data2),
.read_data1(read_data1_30),
.read_data2(read_data2_30),
.read_data3(read_data3_30),
.read_data4(read_data4_30));


line lne29 (.clk(clk),.reset(reset),
.wr1(wr1), .wr2(wr2),
.wen1(wen1[29]),
.wen2(wen2[29]),
.ren1(ren1[29]),
.ren2(ren2[29]),
.ren3(ren3[29]),
.ren4(ren4[29]),
.w_data1(w_data1),
.w_data2(w_data2),
.read_data1(read_data1_29),
.read_data2(read_data2_29),
.read_data3(read_data3_29),
.read_data4(read_data4_29));


line lne28 (.clk(clk),.reset(reset),
.wr1(wr1), .wr2(wr2),
.wen1(wen1[28]),
.wen2(wen2[28]),
.ren1(ren1[28]),
.ren2(ren2[28]),
.ren3(ren3[28]),
.ren4(ren4[28]),
.w_data1(w_data1),
.w_data2(w_data2),
.read_data1(read_data1_28),
.read_data2(read_data2_28),
.read_data3(read_data3_28),
.read_data4(read_data4_28));


line lne27 (.clk(clk),.reset(reset),
.wr1(wr1), .wr2(wr2),
.wen1(wen1[27]),
.wen2(wen2[27]),
.ren1(ren1[27]),
.ren2(ren2[27]),
.ren3(ren3[27]),
.ren4(ren4[27]),
.w_data1(w_data1),
.w_data2(w_data2),
.read_data1(read_data1_27),
.read_data2(read_data2_27),
.read_data3(read_data3_27),
.read_data4(read_data4_27));


line lne26 (.clk(clk),.reset(reset),
.wr1(wr1), .wr2(wr2),
.wen1(wen1[26]),
.wen2(wen2[26]),
.ren1(ren1[26]),
.ren2(ren2[26]),
.ren3(ren3[26]),
.ren4(ren4[26]),
.w_data1(w_data1),
.w_data2(w_data2),
.read_data1(read_data1_26),
.read_data2(read_data2_26),
.read_data3(read_data3_26),
.read_data4(read_data4_26));


line lne25 (.clk(clk),.reset(reset),
.wr1(wr1), .wr2(wr2),
.wen1(wen1[25]),
.wen2(wen2[25]),
.ren1(ren1[25]),
.ren2(ren2[25]),
.ren3(ren3[25]),
.ren4(ren4[25]),
.w_data1(w_data1),
.w_data2(w_data2),
.read_data1(read_data1_25),
.read_data2(read_data2_25),
.read_data3(read_data3_25),
.read_data4(read_data4_25));


line lne24 (.clk(clk),.reset(reset),
.wr1(wr1), .wr2(wr2),
.wen1(wen1[24]),
.wen2(wen2[24]),
.ren1(ren1[24]),
.ren2(ren2[24]),
.ren3(ren3[24]),
.ren4(ren4[24]),
.w_data1(w_data1),
.w_data2(w_data2),
.read_data1(read_data1_24),
.read_data2(read_data2_24),
.read_data3(read_data3_24),
.read_data4(read_data4_24));


line lne23 (.clk(clk),.reset(reset),
.wr1(wr1), .wr2(wr2),
.wen1(wen1[23]),
.wen2(wen2[23]),
.ren1(ren1[23]),
.ren2(ren2[23]),
.ren3(ren3[23]),
.ren4(ren4[23]),
.w_data1(w_data1),
.w_data2(w_data2),
.read_data1(read_data1_23),
.read_data2(read_data2_23),
.read_data3(read_data3_23),
.read_data4(read_data4_23));


line lne22 (.clk(clk),.reset(reset),
.wr1(wr1), .wr2(wr2),
.wen1(wen1[22]),
.wen2(wen2[22]),
.ren1(ren1[22]),
.ren2(ren2[22]),
.ren3(ren3[22]),
.ren4(ren4[22]),
.w_data1(w_data1),
.w_data2(w_data2),
.read_data1(read_data1_22),
.read_data2(read_data2_22),
.read_data3(read_data3_22),
.read_data4(read_data4_22));


line lne21 (.clk(clk),.reset(reset),
.wr1(wr1), .wr2(wr2),
.wen1(wen1[21]),
.wen2(wen2[21]),
.ren1(ren1[21]),
.ren2(ren2[21]),
.ren3(ren3[21]),
.ren4(ren4[21]),
.w_data1(w_data1),
.w_data2(w_data2),
.read_data1(read_data1_21),
.read_data2(read_data2_21),
.read_data3(read_data3_21),
.read_data4(read_data4_21));


line lne20 (.clk(clk),.reset(reset),
.wr1(wr1), .wr2(wr2),
.wen1(wen1[20]),
.wen2(wen2[20]),
.ren1(ren1[20]),
.ren2(ren2[20]),
.ren3(ren3[20]),
.ren4(ren4[20]),
.w_data1(w_data1),
.w_data2(w_data2),
.read_data1(read_data1_20),
.read_data2(read_data2_20),
.read_data3(read_data3_20),
.read_data4(read_data4_20));


line lne19 (.clk(clk),.reset(reset),
.wr1(wr1), .wr2(wr2),
.wen1(wen1[19]),
.wen2(wen2[19]),
.ren1(ren1[19]),
.ren2(ren2[19]),
.ren3(ren3[19]),
.ren4(ren4[19]),
.w_data1(w_data1),
.w_data2(w_data2),
.read_data1(read_data1_19),
.read_data2(read_data2_19),
.read_data3(read_data3_19),
.read_data4(read_data4_19));


line lne18 (.clk(clk),.reset(reset),
.wr1(wr1), .wr2(wr2),
.wen1(wen1[18]),
.wen2(wen2[18]),
.ren1(ren1[18]),
.ren2(ren2[18]),
.ren3(ren3[18]),
.ren4(ren4[18]),
.w_data1(w_data1),
.w_data2(w_data2),
.read_data1(read_data1_18),
.read_data2(read_data2_18),
.read_data3(read_data3_18),
.read_data4(read_data4_18));


line lne17 (.clk(clk),.reset(reset),
.wr1(wr1), .wr2(wr2),
.wen1(wen1[17]),
.wen2(wen2[17]),
.ren1(ren1[17]),
.ren2(ren2[17]),
.ren3(ren3[17]),
.ren4(ren4[17]),
.w_data1(w_data1),
.w_data2(w_data2),
.read_data1(read_data1_17),
.read_data2(read_data2_17),
.read_data3(read_data3_17),
.read_data4(read_data4_17));


line lne16 (.clk(clk),.reset(reset),
.wr1(wr1), .wr2(wr2),
.wen1(wen1[16]),
.wen2(wen2[16]),
.ren1(ren1[16]),
.ren2(ren2[16]),
.ren3(ren3[16]),
.ren4(ren4[16]),
.w_data1(w_data1),
.w_data2(w_data2),
.read_data1(read_data1_16),
.read_data2(read_data2_16),
.read_data3(read_data3_16),
.read_data4(read_data4_16));


line lne15 (.clk(clk),.reset(reset),
.wr1(wr1), .wr2(wr2),
.wen1(wen1[15]),
.wen2(wen2[15]),
.ren1(ren1[15]),
.ren2(ren2[15]),
.ren3(ren3[15]),
.ren4(ren4[15]),
.w_data1(w_data1),
.w_data2(w_data2),
.read_data1(read_data1_15),
.read_data2(read_data2_15),
.read_data3(read_data3_15),
.read_data4(read_data4_15));


line lne14 (.clk(clk),.reset(reset),
.wr1(wr1), .wr2(wr2),
.wen1(wen1[14]),
.wen2(wen2[14]),
.ren1(ren1[14]),
.ren2(ren2[14]),
.ren3(ren3[14]),
.ren4(ren4[14]),
.w_data1(w_data1),
.w_data2(w_data2),
.read_data1(read_data1_14),
.read_data2(read_data2_14),
.read_data3(read_data3_14),
.read_data4(read_data4_14));


line lne13 (.clk(clk),.reset(reset),
.wr1(wr1), .wr2(wr2),
.wen1(wen1[13]),
.wen2(wen2[13]),
.ren1(ren1[13]),
.ren2(ren2[13]),
.ren3(ren3[13]),
.ren4(ren4[13]),
.w_data1(w_data1),
.w_data2(w_data2),
.read_data1(read_data1_13),
.read_data2(read_data2_13),
.read_data3(read_data3_13),
.read_data4(read_data4_13));


line lne12 (.clk(clk),.reset(reset),
.wr1(wr1), .wr2(wr2),
.wen1(wen1[12]),
.wen2(wen2[12]),
.ren1(ren1[12]),
.ren2(ren2[12]),
.ren3(ren3[12]),
.ren4(ren4[12]),
.w_data1(w_data1),
.w_data2(w_data2),
.read_data1(read_data1_12),
.read_data2(read_data2_12),
.read_data3(read_data3_12),
.read_data4(read_data4_12));


line lne11 (.clk(clk),.reset(reset),
.wr1(wr1), .wr2(wr2),
.wen1(wen1[11]),
.wen2(wen2[11]),
.ren1(ren1[11]),
.ren2(ren2[11]),
.ren3(ren3[11]),
.ren4(ren4[11]),
.w_data1(w_data1),
.w_data2(w_data2),
.read_data1(read_data1_11),
.read_data2(read_data2_11),
.read_data3(read_data3_11),
.read_data4(read_data4_11));


line lne10 (.clk(clk),.reset(reset),
.wr1(wr1), .wr2(wr2),
.wen1(wen1[10]),
.wen2(wen2[10]),
.ren1(ren1[10]),
.ren2(ren2[10]),
.ren3(ren3[10]),
.ren4(ren4[10]),
.w_data1(w_data1),
.w_data2(w_data2),
.read_data1(read_data1_10),
.read_data2(read_data2_10),
.read_data3(read_data3_10),
.read_data4(read_data4_10));


line lne9 (.clk(clk),.reset(reset),
.wr1(wr1), .wr2(wr2),
.wen1(wen1[9]),
.wen2(wen2[9]),
.ren1(ren1[9]),
.ren2(ren2[9]),
.ren3(ren3[9]),
.ren4(ren4[9]),
.w_data1(w_data1),
.w_data2(w_data2),
.read_data1(read_data1_9),
.read_data2(read_data2_9),
.read_data3(read_data3_9),
.read_data4(read_data4_9));


line lne8 (.clk(clk),.reset(reset),
.wr1(wr1), .wr2(wr2),
.wen1(wen1[8]),
.wen2(wen2[8]),
.ren1(ren1[8]),
.ren2(ren2[8]),
.ren3(ren3[8]),
.ren4(ren4[8]),
.w_data1(w_data1),
.w_data2(w_data2),
.read_data1(read_data1_8),
.read_data2(read_data2_8),
.read_data3(read_data3_8),
.read_data4(read_data4_8));


line lne7 (.clk(clk),.reset(reset),
.wr1(wr1), .wr2(wr2),
.wen1(wen1[7]),
.wen2(wen2[7]),
.ren1(ren1[7]),
.ren2(ren2[7]),
.ren3(ren3[7]),
.ren4(ren4[7]),
.w_data1(w_data1),
.w_data2(w_data2),
.read_data1(read_data1_7),
.read_data2(read_data2_7),
.read_data3(read_data3_7),
.read_data4(read_data4_7));


line lne6 (.clk(clk),.reset(reset),
.wr1(wr1), .wr2(wr2),
.wen1(wen1[6]),
.wen2(wen2[6]),
.ren1(ren1[6]),
.ren2(ren2[6]),
.ren3(ren3[6]),
.ren4(ren4[6]),
.w_data1(w_data1),
.w_data2(w_data2),
.read_data1(read_data1_6),
.read_data2(read_data2_6),
.read_data3(read_data3_6),
.read_data4(read_data4_6));


line lne5 (.clk(clk),.reset(reset),
.wr1(wr1), .wr2(wr2),
.wen1(wen1[5]),
.wen2(wen2[5]),
.ren1(ren1[5]),
.ren2(ren2[5]),
.ren3(ren3[5]),
.ren4(ren4[5]),
.w_data1(w_data1),
.w_data2(w_data2),
.read_data1(read_data1_5),
.read_data2(read_data2_5),
.read_data3(read_data3_5),
.read_data4(read_data4_5));


line lne4 (.clk(clk),.reset(reset),
.wr1(wr1), .wr2(wr2),
.wen1(wen1[4]),
.wen2(wen2[4]),
.ren1(ren1[4]),
.ren2(ren2[4]),
.ren3(ren3[4]),
.ren4(ren4[4]),
.w_data1(w_data1),
.w_data2(w_data2),
.read_data1(read_data1_4),
.read_data2(read_data2_4),
.read_data3(read_data3_4),
.read_data4(read_data4_4));


line lne3 (.clk(clk),.reset(reset),
.wr1(wr1), .wr2(wr2),
.wen1(wen1[3]),
.wen2(wen2[3]),
.ren1(ren1[3]),
.ren2(ren2[3]),
.ren3(ren3[3]),
.ren4(ren4[3]),
.w_data1(w_data1),
.w_data2(w_data2),
.read_data1(read_data1_3),
.read_data2(read_data2_3),
.read_data3(read_data3_3),
.read_data4(read_data4_3));


line lne2 (.clk(clk),.reset(reset),
.wr1(wr1), .wr2(wr2),
.wen1(wen1[2]),
.wen2(wen2[2]),
.ren1(ren1[2]),
.ren2(ren2[2]),
.ren3(ren3[2]),
.ren4(ren4[2]),
.w_data1(w_data1),
.w_data2(w_data2),
.read_data1(read_data1_2),
.read_data2(read_data2_2),
.read_data3(read_data3_2),
.read_data4(read_data4_2));


line lne1 (.clk(clk),.reset(reset),
.wr1(wr1), .wr2(wr2),
.wen1(wen1[1]),
.wen2(wen2[1]),
.ren1(ren1[1]),
.ren2(ren2[1]),
.ren3(ren3[1]),
.ren4(ren4[1]),
.w_data1(w_data1),
.w_data2(w_data2),
.read_data1(read_data1_1),
.read_data2(read_data2_1),
.read_data3(read_data3_1),
.read_data4(read_data4_1));


line lne0 (.clk(clk),.reset(reset),
.wr1(wr1), .wr2(wr2),
.wen1(wen1[0]),
.wen2(wen2[0]),
.ren1(ren1[0]),
.ren2(ren2[0]),
.ren3(ren3[0]),
.ren4(ren4[0]),
.w_data1(w_data1),
.w_data2(w_data2),
.read_data1(read_data1_0),
.read_data2(read_data2_0),
.read_data3(read_data3_0),
.read_data4(read_data4_0));

endmodule
